package ccrClasses.layer1.procedures;

import ccrClasses.ICcr;
import ccrClasses.layer2.DateTime;
import ccrClasses.layer2.Description;
import ccrClasses.layer2.Source;

public class Procedure implements ICcr {
	
	public static final String OPEN_TAG = "<Procedure>";

	public static final String CLOSE_TAG = "</Procedure>";
	
	private DateTime startDateTime;
	
	private DateTime stopDateTime;
	
	private Description description;
	
	private Source source;

	@Override
	public String constructCcrString() {
		String ccrProcedure = OPEN_TAG;
		if(startDateTime != null){
			ccrProcedure += startDateTime.constructCcrString();
		}
		
		if(stopDateTime != null){
			ccrProcedure += stopDateTime.constructCcrString();		
		}
		
		if(description != null){
			ccrProcedure += description.constructCcrString();
		}
		
		if(source != null){
			ccrProcedure += source.constructCcrString();
		}
		
		ccrProcedure += CLOSE_TAG;
		return ccrProcedure;
	}

	/**
	 * @return the startDateTime
	 */
	public DateTime getStartDateTime() {
		return startDateTime;
	}

	/**
	 * @param startDateTime the startDateTime to set
	 */
	public void setStartDateTime(DateTime startDateTime) {
		this.startDateTime = startDateTime;
	}

	/**
	 * @return the stopDateTime
	 */
	public DateTime getStopDateTime() {
		return stopDateTime;
	}

	/**
	 * @param stopDateTime the stopDateTime to set
	 */
	public void setStopDateTime(DateTime stopDateTime) {
		this.stopDateTime = stopDateTime;
	}

	/**
	 * @return the description
	 */
	public Description getDescription() {
		return description;
	}

	/**
	 * @param description the description to set
	 */
	public void setDescription(Description description) {
		this.description = description;
	}

	/**
	 * @return the source
	 */
	public Source getSource() {
		return source;
	}

	/**
	 * @param source the source to set
	 */
	public void setSource(Source source) {
		this.source = source;
	}

}
